package site.zhouinfo.spider;

import java.util.LinkedList;

/**
 * 队列 保存将要访问的URL
 * Author: zhouinfo
 * mySite: www.zhouinfo.site
 * Create Date：2016-03-23 23:27
 */
public class Queue {
	//使用链表实现队列
	private LinkedList queue = new LinkedList();

	//入队列
	public void enQueue(Object t) {
		queue.addLast(t);
	}

	//出队列
	public Object deQueue() {
		return queue.removeFirst();
	}

	//判断队里是否为空
	public boolean isQueueEmpty() {
		return queue.isEmpty();
	}

	//判断队列是否包含t
	public boolean contians(Object t) {
		return queue.contains(t);
	}
}
